const userReducer = (state = {
    result: 1,
    lastArray: []
}, action) => {
    switch (action.type) {
        case 'ADD_NAME':
            state = {
                ...state,
                name: action.payload,
                lastArray: new Set([...state.lastArray, action.payload])
            }
            break;
        case 'ADD_AGE':
            state = {
                ...state,
                age: action.payload,
                lastArray: new Set([...state.lastArray, action.payload])
            }
            break;
        default:
    }
    return state
}
export default userReducer;